package com.jse.util.concurrent.old.muti;

public class MathThreads {
	public static void main(String args[]) {
		MathSin st = new MathSin(45);
		MathCos ct = new MathCos(60);
		MathTan tt = new MathTan(30);
		st.start();
		ct.start();
		tt.start();
		try { // wait for completion of all thread and then sum
			st.join();
			ct.join(); // wait for completion of MathCos object
			tt.join();
			double z = st.res + ct.res + tt.res;
			//使用join方法让线程执行完
			System.out.println("主线程：Sum of sin, cos, tan = " + z);
		} catch (InterruptedException IntExp) {
		}
	}
}
